package com.sxhuayuan.parking.controller.admin;

import com.sxhuayuan.parking.compenent.Page;
import com.sxhuayuan.parking.compenent.Pageable;
import com.sxhuayuan.parking.compenent.web.RespMessage;
import com.sxhuayuan.parking.entity.Log;
import com.sxhuayuan.parking.service.LogService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 日志查询
 *
 * @author helong
 * @create 2019-03-21 8:42
 */
@RestController("adminLogController")
@RequestMapping("/admin/log")
public class LogController {
    @Resource(name = "logServiceImpl")
    LogService logService;

    /**
     * 日志分页查询
     *
     * @param pageable 分页查询条件
     * @return 分页查询结果集
     */
    @PostMapping("/list")
    public RespMessage list(@RequestBody Pageable pageable) {
        Page<Log> page = logService.findPage( pageable );
        return RespMessage.builder().success().setDatas( page ).build();
    }
}
